package com.jbm.onehome.iface;

import javax.persistence.*;
import com.jbm.core.iface.IAcross;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017-02-22.
 */
@Entity
@Table(name = "focus", schema = "", catalog = "")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class FocusEntity extends IAcross
{
	public FocusEntity()
	{
		super();
	}

	public FocusEntity(IAcross ia)
	{
		super(ia);
	}

    private static final long serialVersionUID = -7214639770725477952L;
    private int focusId;
    private Integer mainId;
    private Integer loginId;
    private Integer praiseType;
    private Timestamp createDate;
    public      FocusEntity(String method,int mainid,int loginid,int praiseType){
        this.method=method;
        this.mainId=mainid;
        this.loginId=loginid;
        this.praiseType=praiseType ;
    }

    @Id
    @Column(name = "focus_id")
    @GeneratedValue
    public int getFocusId() {
        return focusId;
    }

    public void setFocusId(int focusId) {
        this.focusId = focusId;
    }

    @Basic
    @Column(name = "main_id")
    public Integer getMainId() {
        return mainId;
    }

    public void setMainId(Integer mainId) {
        this.mainId = mainId;
    }

    @Basic
    @Column(name = "login_id")
    public Integer getLoginId() {
        return loginId;
    }

    public void setLoginId(Integer loginId) {
        this.loginId = loginId;
    }

    @Basic
    @Column(name = "praise_type")
    public Integer getPraiseType() {
        return praiseType;
    }

    public void setPraiseType(Integer praiseType) {
        this.praiseType = praiseType;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FocusEntity that = (FocusEntity) o;

        if (focusId != that.focusId) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (loginId != null ? !loginId.equals(that.loginId) : that.loginId != null) return false;
        if (mainId != null ? !mainId.equals(that.mainId) : that.mainId != null) return false;
        if (praiseType != null ? !praiseType.equals(that.praiseType) : that.praiseType != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = focusId;
        result = 31 * result + (mainId != null ? mainId.hashCode() : 0);
        result = 31 * result + (loginId != null ? loginId.hashCode() : 0);
        result = 31 * result + (praiseType != null ? praiseType.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        return result;
    }

    @Transient
    public boolean back;
    @Transient
    public String method;
    @Transient
    public String errorinfo;
    @Transient
    public int count;
    @Transient
    public int start=0;
    @Transient
    public int pagesize=0;
    @Transient
    public Integer tableid;
}
